package Test8;

import java.io.*;
import java.util.zip.ZipOutputStream;

public class Demo5 {
    public static void main(String[] args) throws FileNotFoundException {
        File src=new File("D:\\Test");
        File dec=new File("D:\\");
        method(src,dec);
    }public static void method(File src ,File dec) throws FileNotFoundException {
        File[]files=src.listFiles();
        for (File file:files){
            if (file.isFile()){
                ZipOutputStream zos=new ZipOutputStream(new FileOutputStream(file.getName()));
            }
        }

    }
}
